//
//  MarketTableHeaderView.swift
//  Exchange
//
//  Created by rui on 2018/5/3.
//  Copyright © 2018年 common. All rights reserved.
//

import UIKit


class MarketTableHeaderView: UIView {
    
    lazy var varity:UILabel = {
        let lbl = UILabel()
        lbl.font = UIFont.systemFont(ofSize: 12)
        lbl.themeTextColor = ThemeManager.ThemeColorKeys.text3
        let text = kText("币种名")
        lbl.text = text
        lbl.textAlignment = .left
        return lbl
    }()
    
    lazy var lastPrice:UILabel = {
        let lbl = UILabel()
        lbl.font = UIFont.systemFont(ofSize: 12)
        lbl.themeTextColor = ThemeManager.ThemeColorKeys.text3
        lbl.text = kText("最新价")
        lbl.textAlignment = .left
        return lbl
    }()
    
    lazy var increase:UILabel = {
        let lbl = UILabel()
        lbl.font = UIFont.systemFont(ofSize: 12)
        lbl.themeTextColor = ThemeManager.ThemeColorKeys.text3
        lbl.text = kText("24H涨跌")
        lbl.textAlignment = .right
        return lbl
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        initUI()
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func layoutSubviews() {
        super.layoutSubviews()
        varity.frame = CGRect(x: 16, y: 0, width: kSCREEN_WIDTH*0.33 - 16, height: self.height)
        lastPrice.frame = CGRect(x: varity.right, y: 0, width: kSCREEN_WIDTH*0.33, height: self.height)
        increase.frame = CGRect(x: lastPrice.right, y: 0, width: kSCREEN_WIDTH*0.33 - 16, height: self.height)
    }
    func initUI() {
        self.themeBackground = ThemeManager.ThemeColorKeys.background
        addSubview(varity)
        addSubview(lastPrice)
        addSubview(increase)
    }
}
